#!/usr/bin/env python
# -*- coding:utf-8 -*-
# __author__ = "tingfeng"
# Date: 2020/4/30

import os
class DosCmd:
    def excute_cmd_result(self,command):
            result_list = []
            result = os.popen(command).readlines()
            # result_str = ''.join(result)
            # print(result_str)
            #
            # result_table = result_str.split(',')

            for i in result:
                if i =='\n':
                        continue
                result_list.append(i.strip('\n'))
            return result_list

    def excute_cmd(self,command):
            os.system(command)


if __name__ == '__main__':
    dos = DosCmd()
    print(dos.excute_cmd_result('adb devices'))



